<?php

function smarty_function_get_all_type($params, &$smarty) {
    //Get value from page

    $pntables = pnDBGetTables();
    $table  = $pntables['icarrent_type'];
    $column = $pntables['icarrent_type_column'];
      //Query data

      $sql = "SELECT
      					$table.$column[id],
                $table.$column[name]  
              FROM
                $table";

      $column = array("tpy_id","type_name");
      $result = DBUtil::executeSQL($sql);
      $typeArray = DBUtil::marshallObjects ($result, $column);
      $smarty->assign('typeArray', $typeArray); 

}